<?php

namespace app\admin\controller;

class System extends Base
{
    public function system()
    {
        if (request()->isAjax()) {
            $data = [
                'id' => input('id'),
                'webname' => input('webname'),
                'shortname' => input('shortname'),
                'copyright' => input('copyright')
            ];
            $result = model('System')->edit($data);
            if ($result == 1) {
                $this->success('信息更新成功!', 'admin/home/index');
            }else {
                $this->error($result);
            }
        }
        $systemInfo = model('System')->find();
        $viewData = [
            'systemInfo' => $systemInfo
        ];
        $this->assign($viewData);
        return view();
    }
}
